#$arraytype="ILL_550_V3";
#$arraytype="AFFY_6";
$arraytype = "ILL_1M";
#$dir = "/data1/bsi/BORA_processing/genotyping_imp_workflow";
#$refpath = "$dir/bin/FwdStrand_Naresh/ref/$arraytype/FWD_REF_INFO";
#$cmd_system = "/bin/sh $dir/bin/FwdStrand_Naresh/bin/RunFwd.sh $dir/bin/FwdStrand_Naresh /data1/bsi/BORA_processing/tcga_genotyping/ /data1/bsi/BORA_processing/tcga_genotyping/GBM.tped /data1/bsi/BORA_processing/tcga_genotyping/logfile $arraytype $refpath";
$dir = "/data1/bsi/BORA_processing/devel/data_HTHGU/illumina1/MayoGAP/mayogap_emerge/raw/clean/beagle/run_beagle/beagle_mainrun/workflow";
$cmd_system = "/bin/sh $dir/bin/FwdStrand_Naresh/bin/RunFwd.sh $dir/bin/FwdStrand_Naresh /data1/bsi/BORA_processing/tcga_genotyping/ /data1/bsi/BORA_processing/tcga_genotyping/ILLLUSC.tped /data1/bsi/BORA_processing/tcga_genotyping/logfile $arraytype";
system($cmd_system);
$arraytype="AFFY_6";
$dir = "/data1/bsi/BORA_processing/devel/data_HTHGU/illumina1/MayoGAP/mayogap_emerge/raw/clean/beagle/run_beagle/beagle_mainrun/workflow";
$cmd_system = "/bin/sh $dir/bin/FwdStrand_Naresh/bin/RunFwd.sh $dir/bin/FwdStrand_Naresh /data1/bsi/BORA_processing/tcga_genotyping/ /data1/bsi/BORA_processing/tcga_genotyping/LUSC1.tped /data1/bsi/BORA_processing/tcga_genotyping/logfile $arraytype";
system($cmd_system);
$sys = "awk '{if(".'$2'.">1)print ".'$1'."}' fwdStrandFlippedInd_ILLLUSC.txt >drop_snps_ILLLUSC.txt";
system($sys);
$sys = "awk '{if(".'$2'.">1)print ".'$1'."}' fwdStrandFlippedInd_LUSC1.txt > drop_snps_LUSC1.txt";
system($sys);
system("/data1/bsi/BORA_processing/genotyping_imp_workflow/bin/plink/plink  --tfile fwdStrandResults_LUSC1 --exclude drop_snps_LUSC1.txt --make-bed --out fwdStrandResults_LUSC1");
system("/data1/bsi/BORA_processing/genotyping_imp_workflow/bin/plink/plink  --tfile fwdStrandResults_ILLLUSC --exclude drop_snps_ILLLUSC.txt --make-bed --out fwdStrandResults_ILLLUSC");
system("/data1/bsi/BORA_processing/genotyping_imp_workflow/bin/plink/plink  --bfile fwdStrandResults_LUSC1 --bmerge fwdStrandResults_ILLLUSC.bed fwdStrandResults_ILLLUSC.bim fwdStrandResults_ILLLUSC.fam --make-bed --out ./LUSC_finalresults/LUSC");

